<template>
    <div>
        <input type="text" v-model="texts">
        <button @click="add">添加</button>
    </div>
</template>

<script>
export default {
    data() {
        return {
            texts: ''
        }
    },
    methods: {
        add() {
            this.$emit('add', this.texts);
            this.texts = '';
        }
    }
}
</script>

<style>
</style>